<template>
  <div>
    <button type="text" @click="fn('18w')">娶媳妇花了18w</button>
    <button type="text" @click="fn('84w')">买房子花了84w</button>
    <button type="text" @click="fn('12w')">买车花了12w</button>
    <a href="" @click="fn">你猜我会不会跳转</a>
    <div @click="fn1(100)">
      <div @click="add(1000, $event)">我是子级盒子</div>
    </div>

    <div>{{ b | add }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      age: 18,
      u: 1,
      b: 20,
    }
  },
  methods: {
    fn(e) {
      e.stopPropagation()
    },
    fn1(num) {
      console.log(num, '我是父级盒子')
    },
    add(sum, a) {
      a.stopPropagation()
      console.log('我是子级盒子', sum)
    },
  },
}
</script>

<style scoped></style>
